package kr.couponplay.android.support;

import android.content.Context;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.content.pm.PackageManager.NameNotFoundException;

public class AppUtils {
	public static String getAppVersion(Context context) {
		PackageManager pm = context.getPackageManager();
		try {
			PackageInfo packageInfo = pm.getPackageInfo(context.getPackageName(), PackageManager.GET_SIGNATURES);
			return packageInfo.versionName;
		} catch (NameNotFoundException e) {
			throw new IllegalArgumentException(e);
		}
	}
}
